import styled from 'styled-components';
import LogoPic from '@/static/logo.png';
import {Blue, DarkFontColor, LightFontColor, Red, StrongBackgroundColor, Yellow} from "@/style/Color";

export const unSelect = styled.div`
  cursor: pointer;
  /* 使按钮无法被选中：↓ */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  /* 使按钮无法被选中：↑ */
`
export const HeaderContainer = styled.div`
  max-width: 1440px;
  min-width: 800px;
  margin: 0 auto;
`
export const BigSpace = styled.div`
  width: 100%;
  height: 58px;
`
export const HeaderWrapper = styled.div`
  background-color: ${StrongBackgroundColor};
  color: ${DarkFontColor};
  z-index: 999;
  position: fixed;
  left: 0;
  transition: .3s ease-in-out;
  top: ${props => props.headerNeedFixed ? '0' : props.isScrollToTop ? 0 : '-56px'};
  height: 56px;
  min-width: 800px;
  font-size: 10px;
`

export const LOGO = styled.a.attrs({})`
  float: left;
  width: 100px;
  display: block;
  background: url(${LogoPic}) no-repeat center;
  background-size: contain;
  margin: 3px 0;
  height: 50px;
`

export const Nav = styled.div`
  width: 960px;
  margin: 0 auto;
  height: 100%;
  padding-right: 70px;
  box-sizing: border-box;
`

export const NavItem = styled(unSelect)`
  margin-right: 10px;
  color: ${DarkFontColor};
  line-height: 56px;
  padding: 0 15px;
  height: 100%;
  font-size: 15px;
  font-weight: 600;

  &.uploadPage{
    transition: .2s ease-in-out;
    margin: 0 5px;
    color: ${Yellow};
    :hover{
      color: ${Red};
    }
  }
  
  &.left {
    float: left;
  }

  &.right {
    float: right;
    a{
      transition: .2s ease-in-out;
      margin: 0 5px;
      color: ${DarkFontColor};
      :hover{
        color: ${Blue};
      }
    }
  }

  &.active {
    color: #ff5f41;
    font-weight: 600;
  }

  &.mine {
    color: #5ab8f1;
    float: right;
  }
`

export const SearchInfoItem = styled.a`
  color: #333;
  font-size: 12px;
  padding: 0 5px;
  line-height: 20px;
  border: 1px solid #777;
  border-radius: 3px;
  display: block;
  width: 110px;
  height: 25px;
  float: left;
  margin: 10px 10px 10px 0px;

  :hover {
    color: #ea6f5a;
  }
`
export const Conversion = styled.div`
  cursor: pointer;
  float: right;

  :hover {
    color: #ea6f5a;
  }

  span {
    float: right;
    margin-right: 5px;
  }

  .spin {
    transition: all .2s ease-in;
    transform-origin: center center;
    margin-right: 5px;
  }
`
export const SearchInfoTitle = styled.div`
  table-layout: fixed;
  word-break: break-all;
  margin-top: 10px;
  margin-bottom: 15px;
  line-height: 30px;
  font-size: 15px;

`
export const SearchInfoList = styled.div`
  float: left;
`
export const SearchInfoContainer = styled.div`
  .iconfont {
    float: right;
  }

  background-color: white;
  box-shadow: 0 0 5px rgba(0, 0, 0, 2);
  padding: 0 20px 10px;
  border-radius: 5px;
  color: #969696;
  cursor: auto;
  position: absolute;
  left: 20px;
  top: 56px;
  border: 1px solid #969696;
  max-height: 300px;
  overflow: auto;

  &.display {
    display: block;
    width: 300px;
  }

  &.hidden {
    display: none;
  }
`

export const SearchBox = styled.input.attrs({
    placeholder: '搜索'
})`
  &.slide-enter {
    transition: all 0.3s ease-out;
  }

  &.slide-enter-active {
    width: 400px;
  }

  &.slide-exit {
    transition: all 0.3s ease-out;
  }

  &.slide-exit-active {
    width: 320px;
  }

  //width: 320px;
  width: ${props => props.headerNeedFixed ? '0' : '320px'};
  height: 38px;
  border: none;
  outline: none;
  border-radius: 19px;
  background-color: #eee;
  /*此padding-right为鼠标未聚焦状态下的尺寸*/
  padding: ${props => props.headerNeedFixed ? '0' : '0 32px 0 15px'};
  margin-top: 9px;
  box-sizing: border-box;
  //margin-left: 20px;
  font-size: 14px;
  color: #555555;

  &::placeholder {
    color: #999;
  }

  &.search-focus {
    width: 400px;
  }
`
export const Addition = styled.div`
  float: right;
  height: 56px;
`

export const Button = styled(unSelect)`
  float: right;
  margin-top: 9px;
  line-height: 38px;
  border: 1px solid #ec6149;
  border-radius: 19px;
  margin-right: 20px;
  padding: 0 20px;
  font-size: 14px;

  &.reg {
    color: #ec6149;
  }

  &.writing {
    background-color: #ec6149;
    color: #f0f0f0;
    transition: .2s ease-out;

    :hover {
      border: 1px solid #ea9177;
      background-color: #ea9177;
    }
  }
`
export const SearchBoxWrapper = styled(unSelect)`
  float: left;
  position: relative;
  z-index: 10;
  div,svg,input{
    transition: .2s ease-in-out;
  }
  .zoom {
    position: absolute;
    right: 15px;
    bottom: 5px;
    //width: 30px;
    line-height: 30px;
    border-radius: 15px;
    text-align: center;
    transition: .5s ease-out;

    &.search-focus {
      z-index: 999;
      color: #fff;
    }
  }
`

